package com.lyl.springcloud.service;

import com.lyl.springcloud.model.Payment;
import com.lyl.springcloud.model.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author lylbell
 * @date 2021-05-28 10:47
 */
@Component
@FeignClient("CLOUD-PROVIDER-PAYMENT") //去eureka中服务名称为CLOUD-PROVIDER-PAYMENT的服务，并查找该服务中的/payment/getById/{id}的方法
public interface OrderFeignService {

    @GetMapping("/payment/getById/{id}")
    Result<Payment> getPayment(@PathVariable("id") Long id);


    @GetMapping("/payment/timeout")
    String feignTimeOut();
}
